<?php
class CerezaHelper extends AppHelper {

	var $helpers = array(
        'Html',
        'Form',
        'Ajax',
        'Text'
    );

	function encuesta ($tipo = null, $valor = null) {

		$tipo = $this->Text->toLow($tipo);

		if(!is_int($valor)){
			$valor = (int) $valor;
		}

		if($tipo == 'dominio'){
			if($valor === 4) $var = "Excelente";
			if($valor === 3) $var = "Bueno";
			if($valor === 2) $var = "Regular";
			if($valor === 1) $var = "Pobre";
			if($valor === 0) $var = "Deficiente";
		}
		if($tipo == 'dudas'){
			if($valor === 4) $var = "Todas";
			if($valor === 3) $var = "La mayoria";
			if($valor === 2) $var = "Algunas veces";
			if($valor === 1) $var = "Las evade";
			if($valor === 0) $var = "Ninguna";
		}
		if($tipo == 'puntualidad'){
			if($valor === 4) $var = "Puntual";
			if($valor === 3) $var = "A veces puntual otras no";
			if($valor === 2) $var = "Puntual pero falto un dia o mas";
			if($valor === 1) $var = "Impuntual y da excusas";
			if($valor === 0) $var = "Muy impuntual";
		}
		if($tipo == 'pensum'){
			if($valor === 4) $var = "Todo";
			if($valor === 3) $var = "Casi todo";
			if($valor === 2) $var = "Medianamente";
			if($valor === 1) $var = "Algunos puntos";
			if($valor === 0) $var = "Nada";
		}
		if($tipo == 'general'){
			if($valor === 4) $var = "Excelente";
			if($valor === 3) $var = "Bueno";
			if($valor === 2) $var = "Regular";
			if($valor === 1) $var = "Pobre";
			if($valor === 0) $var = "Deficiente";
		}
		return $var;
	}

	function tablaTop ($width = 845) {
		return "<table class='tablaContenido' border='0' cellpadding='0' cellspacing='0' style='width: $width.px'>
      <tbody style='border: none'><tr>
        <td valign='top' width='8' align='left'> $this->Html->image('caja01_esquinasupizq.gif') </td>
        <td height='7' valign='top' align='left' background='{$this->webroot}img/caja01_lateralsup.gif'></td>
        <td valign='top' width='8' align='left'> $this->Html->image('caja01_esquinasupder.gif') </td>
      </tr>
      <tr >
        <td valign='top' align='left' background='{$this->webroot}img/caja01_lateralizq.gif'></td>
        <td height='123' valign='top'>";
	}

	function tablaMid () {
		return "</td>
        <td background='{$this->webroot}img/caja01_lateralder.gif'></td>
      </tr>
      <tr>
        <td valign='top' align='left' background='<?php echo $this->webroot?>img/caja01_lateralizq.gif'></td>
        <td valign='top'>";
	}

	function tablaBot () {
		return "</td>
        	<td background='<?php echo $this->webroot?>img/caja01_lateralder.gif'></td>
	      </tr>
	      <tr>
	        <td valign='top' align='left'>$this->Html->image('caja01_esquinainfizq.gif')</td>
	        <td height='7' background='{$this->webroot}caja01_lateralinf.gif'></td>
	        <td valign='top' align='left'>$this->Html->image('caja01_esquinainfder.gif')</td>
	      </tr>
	    </tbody>
		</table>";
	}

}
?>